// 倒计时转换
function countDown () {
  const now = new Date()
  now.setHours(0)
  now.setMinutes(0)
  now.setSeconds(0)
  now.setMilliseconds(0)
  const today = +new Date(now)
  const oneday = 24 * 60 * 60 * 1000
  const tomorrow = today + oneday
  const nowTime = +new Date()
  const times = (tomorrow - nowTime) / 1000

  let h = parseInt(times / 60 / 60 % 24) // 时
  h = h < 10 ? '0' + h : h
  let m = parseInt(times / 60 % 60) // 分
  m = m < 10 ? '0' + m : m
  let s = parseInt(times % 60) // 秒
  s = s < 10 ? '0' + s : s
  return h + ':' + m + ':' + s
}

module.exports = countDown
